/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.uel.ati.entity.grad;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import lombok.Data;

/**
 *
 * @author humberto
 */
@Data
@Entity
@Table(name = "grupo")
@NamedQueries({
    @NamedQuery(name = "Grupo.findAll", query = "SELECT g FROM Grupo g"),
    @NamedQuery(name = "Grupo.findByNome", query = "SELECT g FROM Grupo g WHERE g.grupoPK.nome = :nome"),
    @NamedQuery(name = "Grupo.findByUsuario", query = "SELECT g FROM Grupo g WHERE g.grupoPK.usuario = :usuario")})
public class Grupo implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected GrupoPK grupoPK;
    @JoinColumn(name = "usuario", referencedColumnName = "nome", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Usuario usuario1;
}
